<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <title>?系统登录</title>

    <link rel="stylesheet" href="__PLUGIN_TMPL__/assets/css/admin_login.css" />
    <link rel="stylesheet" href="__PLUGIN_TMPL__/assets/css/swiper.min.css" />
    <style>
        .login-form .form-group {
            margin: 20px 0;
        }
    </style>
</head>

<body class="page-login-v3">
    <div class="container">
        {$Title}
        <div id="wrapper" class="login-body">
            <div class="swep-left">
                <div>
                    <div class="swiper-container">
                        <div class="swiper-wrapper">
                            <div class="swiper-slide"><img src="__PLUGIN_TMPL__/assets/images/login_bg.jpg"></div>
                            <div class="swiper-slide"><img src="__PLUGIN_TMPL__/assets/images/login_bg1.jpg"></div>
                            <div class="swiper-slide"><img src="__PLUGIN_TMPL__/assets/images/login_bg2.jpg"></div>
                        </div>
                        <!-- Add Pagination -->
                        <div class="swiper-pagination"></div>
                    </div>
                </div>
            </div>
            <div class="login-content" id="login">
                <div class="brand">
                    <img alt="logo" class="brand-img" src="__PLUGIN_TMPL__/assets/images/logo.png">
                    <h2 class="brand-text">{$config.p_name}</h2>
                </div>
                <form id="login-form" class="login-form">
                    <div class="form-group">
                        <input name="username" placeholder="请输入用户名" type="text" required>
                    </div>
                    <div class="form-group">
                        <input name="password" placeholder="请输入密码" type="password" required>
                    </div>
                    <div class="form-group">
                        <input name="captcha" placeholder="请输入验证码" type="text" required style="width: 50%;float: left">
                        <captcha height="42" width="170px" font-size="18" style="cursor: pointer;" />
                    </div>
                    <div class="form-group" style="margin-bottom:-21px;">
                        <button id="login-submit" type="submit">
                            登录
                        </button>
                    </div>
                    <div class="form-group" style="margin-top:23px;">
                        <a href="https://f.kjdll.cn:9999/plugin/xiongyi/wechat/login">
                            <img alt="微信登录" class="brand-img" src="__PLUGIN_TMPL__/assets/images/wxlogin_button.png" />
                        </a>
                    </div>

                </form>
            </div>
        </div>
    </div>
</body>
<script src="__PLUGIN_TMPL__/assets/js/jquery.js"></script>
<script src="__PLUGIN_TMPL__/assets/js/swiper.min.js"></script>
<script src="__PLUGIN_TMPL__/assets/js/layer/layer.js"></script>
<script src="__PLUGIN_TMPL__/assets/js/jquery.form.min.js"></script>

<script>
    // 表单提交
    var $form = $('#login-form');
    $form.submit(function () {
        var $btn_submit = $('#login-submit');
        //$btn_submit.attr("disabled", true);
        $form.ajaxSubmit({
            type: "post",
            dataType: "json",
            url: "{:url('public/doLogin')}",
            success: function (result) {
                $btn_submit.attr('disabled', false);
                if (result.code === 1) {
                    localStorage.setItem('token', result.data.token);//*马的，保存token到本地
                    layer.msg(result.msg, { time: 1500, anim: 1 }, function () {
                        window.location = result.url;
                    });
                    return true;
                } else {
                    $('.verify_img').trigger('click')
                }
                layer.msg(result.msg, { time: 1500, anim: 6 });
            }
        });
        return false;
    });

    var swiper = new Swiper('.swiper-container', {
        loop: true,
        autoplay: {
            delay: 3000,
        },
        pagination: {
            el: '.swiper-pagination',
        },
    });


</script>

</html>